package DemoMovieSystem;

public class MovieOperator {
    private Movie[] movies;
    public MovieOperator(Movie[] movies){
        this.movies=movies;
    }
    public void PrintMovie(){
        System.out.println("------电影全部信息如下：------");
        for (int i = 0; i < movies.length; i++) {
            Movie m=movies[i];
            System.out.println("编号："+m.getId());
            System.out.println("名称："+m.getName());
            System.out.println("价格："+m.getPrize());
            System.out.println("--------------------------");
        }
    }
    public void SearchMovieById(int id){
        for (int i = 0; i < movies.length; i++) {
            Movie m=movies[i];
            if(id==m.getId())
            {
                System.out.println("该电影详情如下：");
                System.out.println("编号："+m.getId());
                System.out.println("名称："+m.getName());
                System.out.println("价格："+m.getPrize());
                System.out.println("评分："+m.getScore());
                System.out.println("导演："+m.getDirector());
                System.out.println("演员："+m.getActor());
                System.out.println("其他信息："+m.getInfo());
                return;
            }
        }
        System.out.println("没找到该电影~");
    }
}
